

import UIKit

/*********************************************************************
* The Swift Language Learning  Chapter 03: String & Character
*********************************************************************/


let dollarSign = "\x24"        // $,  Unicode scalar U+0024
let blackHeart = "\u2665"      // ♥,  Unicode scalar U+2665
let sparklingHeart = "\U0001F496"  // 💖, Unicode scalar U+1F496”

let yenSign: Character = "¥" //not a String


let unusualMenagerie = "kroa"
println("unusualMenagerie has \(countElements(unusualMenagerie)) characters")
countElements(unusualMenagerie)



/*
* unicode
*/
let dogString = "Dog!🐶"
for char in dogString.utf8 {
	println(char) //68 111 103 33 240 159 144 182
}

println ("\n")

for char in dogString.utf16 {
	println(char)//68 111 103 33 55357 56374
}

println ("\n")

for char in dogString.unicodeScalars {
	println(char)//D o g ! 🐶
}
